﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace jnlamp.Web.api
{
    public partial class get_time : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["sim_id"]))
                {
                    string sim_id = Request["sim_id"];

                    string time = DateTime.Now.ToShortTimeString();

                    string[] ts = time.Split(':');

                    string hours = "";
                    int hour = Convert.ToInt32(ts[0]);

                    if (hour < 10)
                    {
                        hours = "0" + hour;
                    }
                    else
                    {
                        hours = hour.ToString();
                    }

                    

                    time = hours + ts[1];

                    Response.Write("CTIME" + time);
                }
                else
                {
                    Response.Write("DTIME0");
                }
            }
        }
    }
}